<!-- Definimos la herencia -->
{% extends "generico.html" %}
<!-- Listado de blockes especificos de formularios -->
	{% block titulo %}thread: {{title}} {% endblock %}
	
	{% block central %}
			<table align="center" border="0" width="80%">
				<tr>
					<td valign="top">
						<b><u>{{ thread.titulo }}</u></b><br>
						<i>(Autor: <a href="/usr/profile/{{thread.autor.id}}">{{thread.autor}}</a>)</i>
					</td>
					<td valign="top" align="right">
						{% if logged %}
							<img src="/static/votar.jpeg" border="0" height="25" width="230" usemap="#voto{{thread.id}}" align="top">
							<map name="voto{{thread.id}}">
								<area shape="rect" coords="0,0,45,25" href="contplus{{thread.id}}" />
								<area shape="rect" coords="50,0,95,25" href="contless{{thread.id}}" />
								<area shape="rect" coords="100,0,230,25" href="cont/denuncia{{thread.id}}" />
							</map>
							<img src="/static/profiles/{{thread.autor.get_profile.pic}}" alt="PF" width="100"  height="100" hspace="0" vspace="0" border="1">
						{% endif %}
						<p>
							<font size="-1" color="#333333"><i>Puntaje del thread: {{thread.puntaje}}</i></font><br>
							<font size="-1" color="#333333"><i>Fecha: {{thread.fecha_creacion}}</i></font>
						</p>
					</td>
				</tr>
				<tr>
					<td colspan="2" align="center">
						{{thread.body|safe }}
					<td>
				</tr>
			</table>
						
			{% for post in posts %}
				<div align="center" id="comentarios" style="border:#666666;width:50%; left:25%; margin-left:25%">
					<hr>
					<img src="/static/profiles/{{post.autor.get_profile.pic}}" align="right" alt="PF" width="50"  height="50" hspace="0" vspace="0" border="1">
					<p align="left">
						<b><u><a href="/usr/profile/{{post.autor.id}}">{{post.autor}}</a></b> dijo el {{post.fecha_creacion}}:</u>
					</p>
					{{post.body}}<br /><br />
					{% if logged %}
						<img src="/static/votar.jpeg" border="0" height="25" width="230" usemap="#votopost{{post.id}}" align="right">
						<map name="votopost{{post.id}}">
								<area shape="rect" coords="0,0,45,25" href="postplus{{post.id}}" />
								<area shape="rect" coords="50,0,95,25" href="postless{{post.id}}" />
								<area shape="rect" coords="100,0,230,25" href="post/denuncia{{post.id}}" />
						</map>
					{% endif %}
					<font size="-2"><i>Puntaje: {{post.puntaje}}</i></font>
				</div><br />
			{% endfor %}
			{% if logged %}
				<form action="" method = "post">
					<center>
						{{form.as_p}}
						<input type="submit" value="Comentar">
					</center>
				</form>
			{% else %}
				<center><font size="-2">Debe estar loggeado para hacer comentarios</font></center>
			{% endif %}
	{% endblock %}